package com.ruoyi.baseInfo.service.Impl;

import com.ruoyi.baseInfo.domain.Customer;
import com.ruoyi.baseInfo.mapper.CustomerMapper;
import com.ruoyi.baseInfo.service.ICustomerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 顾客信息 服务层实现
 *
 * @author ruoyi
 */
@Service
public class CustomerServiceImpI implements ICustomerService
{
    @Autowired
    CustomerMapper customerMapper;

    /**
     * 查询顾客信息
     *
     * @param customerId 顾客ID
     * @return 顾客信息
     */
    @Override
    public Customer selectCustomerById(Long customerId)
    {
        return customerMapper.selectCustomerById(customerId);
    }

    /**
     * 查询顾客信息列表
     *
     * @param customer 顾客信息
     * @return 顾客集合
     */
    @Override
    public List<Customer> selectCustomerList(Customer customer)
    {
        return customerMapper.selectCustomerList(customer);
    }

    /**
     * 新增顾客信息
     *
     * @param customer 顾客信息
     * @return 结果
     */
    @Override
    public int insertCustomer(Customer customer)
    {
        return customerMapper.insertCustomer(customer);
    }

    /**
     * 修改顾客信息
     *
     * @param customer 顾客信息
     * @return 结果
     */
    @Override
    public int updateCustomer(Customer customer)
    {
        return customerMapper.updateCustomer(customer);
    }

    /**
     * 删除顾客信息
     *
     * @param customer 顾客ID
     * @return 结果
     */
    @Override
    public int deleteCustomerById(Customer customer)
    {
        return customerMapper.deleteCustomerById(customer);
    }

    /**
     * 批量删除顾客信息
     *
     * @param customerIds 需要删除的顾客ID
     * @return 结果
     */
    @Override
    public int deleteCustomerByIds(Long[] customerIds, String username)
    {
        return customerMapper.deleteCustomerByIds(customerIds, username);
    }
}
